package util;

import com.alibaba.fastjson2.JSONObject;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 于金鹏
 * @Date 2024/12/17 11:02
 * @Package StudentCheckSystem
 */
public class ResponseUtils {
    public static void responseJSON(HttpServletResponse httpServletResponse, Object object) throws IOException {
        httpServletResponse.setCharacterEncoding("UTF-8");
        httpServletResponse.setContentType("application/json");
        httpServletResponse.getWriter().write(JSONObject.toJSONString(object));
    }
}
